def intervalIntersection(firstList, secondList):
    i, j = 0, 0
    intersections = []

    while i < len(firstList) and j < len(secondList):

        start1, end1 = firstList[i]
        start2, end2 = secondList[j]


        if start1 <= end2 and start2 <= end1:

            start_intersect = max(start1, start2)
            end_intersect = min(end1, end2)
            intersections.append([start_intersect, end_intersect])


        if end1 < end2:
            i += 1
        else:
            j += 1

    return intersections



firstList = [[0, 2], [5, 10], [13, 23], [24, 25]]
secondList = [[1, 5], [8, 12], [15, 24], [25, 26]]
print(intervalIntersection(firstList, secondList))